<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Document</title>

</head>

<body>

    <script>

        let arr=Array.of(11,22,33,44,55,66);

        arr["yuan"]="lei";

        for(let i=0;i<arr.length;i++)

        {

            console.log(i+":"+arr[i]);

        }

        arr.forEach(function(v,i){

            console.log(i+":"+v);

        });

        for(let key in arr){

            console.log(key+":"+arr[key]);

        }

        for(let v of arr){

            console.log(v);

        }

        let narr=arr.map(function(v,i){

            console.log(i+":"+v);

            return v=v*v;

           

        })

   

        console.log(narr);

        arr.forEach((v,k)=>{

            console.log(v,k);

        })

    </script>

</body>

</html>